<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>blmc_robots: blmc_robots::BlmcJointModule Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">blmc_robots
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classblmc__robots_1_1BlmcJointModule.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classblmc__robots_1_1BlmcJointModule-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">blmc_robots::BlmcJointModule Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The <a class="el" href="classblmc__robots_1_1BlmcJointModule.html" title="The BlmcJointModule class is containing the joint information. ">BlmcJointModule</a> class is containing the joint information.  
 <a href="classblmc__robots_1_1BlmcJointModule.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="blmc__joint__module_8hpp_source.html">blmc_joint_module.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a09a0b8815e6c447e3ee6632ade940e0b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a09a0b8815e6c447e3ee6632ade940e0b">BlmcJointModule</a> (std::shared_ptr&lt; blmc_drivers::MotorInterface &gt; motor, const double &amp;motor_constant, const double &amp;gear_ratio, const double &amp;zero_angle, const bool &amp;reverse_polarity=false, const double &amp;max_current=2.1)</td></tr>
<tr class="memdesc:a09a0b8815e6c447e3ee6632ade940e0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a new <a class="el" href="classblmc__robots_1_1BlmcJointModule.html" title="The BlmcJointModule class is containing the joint information. ">BlmcJointModule</a> object.  <a href="#a09a0b8815e6c447e3ee6632ade940e0b">More...</a><br /></td></tr>
<tr class="separator:a09a0b8815e6c447e3ee6632ade940e0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adeb28005a7160ead68603aed4262508f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#adeb28005a7160ead68603aed4262508f">set_torque</a> (const double &amp;desired_torque)</td></tr>
<tr class="memdesc:adeb28005a7160ead68603aed4262508f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the joint torque to be sent.  <a href="#adeb28005a7160ead68603aed4262508f">More...</a><br /></td></tr>
<tr class="separator:adeb28005a7160ead68603aed4262508f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae59680a947539306e391a12ad2d071bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#ae59680a947539306e391a12ad2d071bb">set_zero_angle</a> (const double &amp;zero_angle)</td></tr>
<tr class="memdesc:ae59680a947539306e391a12ad2d071bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the zero_angle.  <a href="#ae59680a947539306e391a12ad2d071bb">More...</a><br /></td></tr>
<tr class="separator:ae59680a947539306e391a12ad2d071bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0484dd9efc47843706fc71d4351bdbd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#af0484dd9efc47843706fc71d4351bdbd">send_torque</a> ()</td></tr>
<tr class="memdesc:af0484dd9efc47843706fc71d4351bdbd"><td class="mdescLeft">&#160;</td><td class="mdescRight">send the joint torque to the motor.  <a href="#af0484dd9efc47843706fc71d4351bdbd">More...</a><br /></td></tr>
<tr class="separator:af0484dd9efc47843706fc71d4351bdbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3445fef0daa4abb432a025eb161a65b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#ac3445fef0daa4abb432a025eb161a65b">get_sent_torque</a> () const </td></tr>
<tr class="memdesc:ac3445fef0daa4abb432a025eb161a65b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the sent joint torque.  <a href="#ac3445fef0daa4abb432a025eb161a65b">More...</a><br /></td></tr>
<tr class="separator:ac3445fef0daa4abb432a025eb161a65b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac18206a4ba25a37368f05bc6de0a655d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#ac18206a4ba25a37368f05bc6de0a655d">get_measured_torque</a> () const </td></tr>
<tr class="memdesc:ac18206a4ba25a37368f05bc6de0a655d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the measured joint torque.  <a href="#ac18206a4ba25a37368f05bc6de0a655d">More...</a><br /></td></tr>
<tr class="separator:ac18206a4ba25a37368f05bc6de0a655d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6543f8befbc9911b67e1f40cf5fa9df1"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a6543f8befbc9911b67e1f40cf5fa9df1">get_measured_angle</a> () const </td></tr>
<tr class="memdesc:a6543f8befbc9911b67e1f40cf5fa9df1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the measured angle of the joint.  <a href="#a6543f8befbc9911b67e1f40cf5fa9df1">More...</a><br /></td></tr>
<tr class="separator:a6543f8befbc9911b67e1f40cf5fa9df1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa857a81f3600c6a7d5da8c8480d460d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#aaa857a81f3600c6a7d5da8c8480d460d">get_measured_velocity</a> () const </td></tr>
<tr class="memdesc:aaa857a81f3600c6a7d5da8c8480d460d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the measured velocity of the joint.  <a href="#aaa857a81f3600c6a7d5da8c8480d460d">More...</a><br /></td></tr>
<tr class="separator:aaa857a81f3600c6a7d5da8c8480d460d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48e936ec25f199c7cb41d2490a4891e0"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a48e936ec25f199c7cb41d2490a4891e0">get_measured_index_angle</a> () const </td></tr>
<tr class="memdesc:a48e936ec25f199c7cb41d2490a4891e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the measured index angle.  <a href="#a48e936ec25f199c7cb41d2490a4891e0">More...</a><br /></td></tr>
<tr class="separator:a48e936ec25f199c7cb41d2490a4891e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50dc60d14f6ef65f04e2eb09231325a4"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a50dc60d14f6ef65f04e2eb09231325a4">get_zero_angle</a> () const </td></tr>
<tr class="memdesc:a50dc60d14f6ef65f04e2eb09231325a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the zero_angle_.  <a href="#a50dc60d14f6ef65f04e2eb09231325a4">More...</a><br /></td></tr>
<tr class="separator:a50dc60d14f6ef65f04e2eb09231325a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a464ab2a846630eba6582d09895df2852"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a464ab2a846630eba6582d09895df2852">set_position_control_gains</a> (double kp, double kd)</td></tr>
<tr class="memdesc:a464ab2a846630eba6582d09895df2852"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set control gains for PD position controller.  <a href="#a464ab2a846630eba6582d09895df2852">More...</a><br /></td></tr>
<tr class="separator:a464ab2a846630eba6582d09895df2852"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ee1d234e2e86d81d3acc687c4c2430e"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a3ee1d234e2e86d81d3acc687c4c2430e">execute_position_controller</a> (double target_position_rad) const </td></tr>
<tr class="memdesc:a3ee1d234e2e86d81d3acc687c4c2430e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute one iteration of the position controller.  <a href="#a3ee1d234e2e86d81d3acc687c4c2430e">More...</a><br /></td></tr>
<tr class="separator:a3ee1d234e2e86d81d3acc687c4c2430e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17a1da041dae31e9a16f955722c36d6c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#a17a1da041dae31e9a16f955722c36d6c">calibrate</a> (double &amp;angle_zero_to_index, double &amp;index_angle, bool mechanical_calibration=false)</td></tr>
<tr class="memdesc:a17a1da041dae31e9a16f955722c36d6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method calibrate the joint position knowing the angle between the closest (in positive torque) motor index and the theoretical zero pose.  <a href="#a17a1da041dae31e9a16f955722c36d6c">More...</a><br /></td></tr>
<tr class="separator:a17a1da041dae31e9a16f955722c36d6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa534604b5ead6a3eee5c47a9454f6834"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#aa534604b5ead6a3eee5c47a9454f6834">init_homing</a> (int joint_id, double search_distance_limit_rad, double home_offset_rad, double profile_step_size_rad=0.001)</td></tr>
<tr class="memdesc:aa534604b5ead6a3eee5c47a9454f6834"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the homing procedure.  <a href="#aa534604b5ead6a3eee5c47a9454f6834">More...</a><br /></td></tr>
<tr class="separator:aa534604b5ead6a3eee5c47a9454f6834"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb2712542f3c340bc0ecf76bd343b6b3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceblmc__robots.html#aa1075809042ff261e4b0a20d161448b6">HomingReturnCode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html#abb2712542f3c340bc0ecf76bd343b6b3">update_homing</a> ()</td></tr>
<tr class="memdesc:abb2712542f3c340bc0ecf76bd343b6b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform one step of homing on encoder index.  <a href="#abb2712542f3c340bc0ecf76bd343b6b3">More...</a><br /></td></tr>
<tr class="separator:abb2712542f3c340bc0ecf76bd343b6b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classblmc__robots_1_1BlmcJointModule.html" title="The BlmcJointModule class is containing the joint information. ">BlmcJointModule</a> class is containing the joint information. </p>
<p>It is here to help converting the data from the motor side to the joint side. It also allows the calibration of the joint position during initialization. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a09a0b8815e6c447e3ee6632ade940e0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">blmc_robots::BlmcJointModule::BlmcJointModule </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; blmc_drivers::MotorInterface &gt;&#160;</td>
          <td class="paramname"><em>motor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>motor_constant</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>gear_ratio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>zero_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const bool &amp;&#160;</td>
          <td class="paramname"><em>reverse_polarity</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>max_current</em> = <code>2.1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Construct a new <a class="el" href="classblmc__robots_1_1BlmcJointModule.html" title="The BlmcJointModule class is containing the joint information. ">BlmcJointModule</a> object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">motor</td><td>is the C++ object allowing us to send commands and receive sensor data. </td></tr>
    <tr><td class="paramname">motor_constant</td><td>( <img class="formulaInl" alt="$ k $" src="form_0.png"/>) is the torque constant of the motor <img class="formulaInl" alt="$ \tau_{motor} = k * i_{motor} $" src="form_1.png"/> </td></tr>
    <tr><td class="paramname">gear_ratio</td><td>is the gear ratio between the motor and the joint. </td></tr>
    <tr><td class="paramname">zero_angle</td><td>is the angle between the closest positive motor index and the zero configuration. </td></tr>
    <tr><td class="paramname">reverse_polarity</td><td></td></tr>
    <tr><td class="paramname">max_current</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a17a1da041dae31e9a16f955722c36d6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool blmc_robots::BlmcJointModule::calibrate </td>
          <td>(</td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>angle_zero_to_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>index_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>mechanical_calibration</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This method calibrate the joint position knowing the angle between the closest (in positive torque) motor index and the theoretical zero pose. </p>
<p>Warning, this method should be called in a real time thread!</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3ee1d234e2e86d81d3acc687c4c2430e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::execute_position_controller </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>target_position_rad</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Execute one iteration of the position controller. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">target_position_rad</td><td>Target position.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Torque command. </dd></dl>

</div>
</div>
<a class="anchor" id="a6543f8befbc9911b67e1f40cf5fa9df1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_measured_angle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the measured angle of the joint. </p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="a48e936ec25f199c7cb41d2490a4891e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_measured_index_angle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the measured index angle. </p>
<p>There is one index per motor rotation so there are gear_ratio indexes per joint rotation.</p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="ac18206a4ba25a37368f05bc6de0a655d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_measured_torque </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the measured joint torque. </p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="aaa857a81f3600c6a7d5da8c8480d460d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_measured_velocity </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the measured velocity of the joint. </p>
<p>This data is computed on board of the control card.</p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="ac3445fef0daa4abb432a025eb161a65b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_sent_torque </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the sent joint torque. </p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="a50dc60d14f6ef65f04e2eb09231325a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double blmc_robots::BlmcJointModule::get_zero_angle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the zero_angle_. </p>
<p>These are the angle between the starting pose and the theoretical zero pose.</p>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

</div>
</div>
<a class="anchor" id="aa534604b5ead6a3eee5c47a9454f6834"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void blmc_robots::BlmcJointModule::init_homing </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>search_distance_limit_rad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>home_offset_rad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>profile_step_size_rad</em> = <code>0.001</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the homing procedure. </p>
<p>This has to be called before <a class="el" href="classblmc__robots_1_1BlmcJointModule.html#abb2712542f3c340bc0ecf76bd343b6b3" title="Perform one step of homing on encoder index. ">update_homing()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">joint_id</td><td>ID of the joint. This is only used for debug prints. </td></tr>
    <tr><td class="paramname">search_distance_limit_rad</td><td>Maximum distance the motor moves while searching for the encoder index. Unit: radian. </td></tr>
    <tr><td class="paramname">home_offset_rad</td><td>Offset from home position to zero position. Unit: radian. </td></tr>
    <tr><td class="paramname">profile_step_size_rad</td><td>Distance by which the target position of the position profile is changed in each step. Set to a negative value to search for the next encoder index in negative direction. Unit: radian. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af0484dd9efc47843706fc71d4351bdbd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void blmc_robots::BlmcJointModule::send_torque </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>send the joint torque to the motor. </p>
<p>The conversion between joint torque and motor current is done automatically. </p>

</div>
</div>
<a class="anchor" id="a464ab2a846630eba6582d09895df2852"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void blmc_robots::BlmcJointModule::set_position_control_gains </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>kp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>kd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set control gains for PD position controller. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">kp</td><td>P gain. </td></tr>
    <tr><td class="paramname">kd</td><td>D gain. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adeb28005a7160ead68603aed4262508f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void blmc_robots::BlmcJointModule::set_torque </td>
          <td>(</td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>desired_torque</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the joint torque to be sent. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">desired_torque</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae59680a947539306e391a12ad2d071bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void blmc_robots::BlmcJointModule::set_zero_angle </td>
          <td>(</td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>zero_angle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the zero_angle. </p>
<p>The zero_angle is the angle between the closest positive motor index and the zero configuration.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">zero_angle</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="abb2712542f3c340bc0ecf76bd343b6b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceblmc__robots.html#aa1075809042ff261e4b0a20d161448b6">HomingReturnCode</a> blmc_robots::BlmcJointModule::update_homing </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform one step of homing on encoder index. </p>
<p>Searches for the next encoder index in positive direction and, when found, sets it as home position.</p>
<p>Only performs one step, so this method needs to be called in a loop.</p>
<p>The motor is moved with a position profile until either the encoder index is reached or the search distance limit is exceeded. The position is controlled with a simple PD controller.</p>
<p>If the encoder index is found, its position is used as home position. The zero position is offset from the home position by adding the "home
offset" to it (i.e. zero = home pos. + home offset). If the search distance limit is reached before the encoder index occurs, the homing fails.</p>
<dl class="section return"><dt>Returns</dt><dd>Status of the homing procedure. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/workspace/software/workspace/src/catkin/robots/blmc_robots/include/blmc_robots/<a class="el" href="blmc__joint__module_8hpp_source.html">blmc_joint_module.hpp</a></li>
<li>/workspace/software/workspace/src/catkin/robots/blmc_robots/src/<a class="el" href="blmc__joint__module_8cpp.html">blmc_joint_module.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceblmc__robots.html">blmc_robots</a></li><li class="navelem"><a class="el" href="classblmc__robots_1_1BlmcJointModule.html">BlmcJointModule</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
